home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / listings / v_13_05 / allison / tset.cpp < prev    next >
C/C++ Source or Header  |  1995-03-12  |  427b  |  27 lines

  1. LISTING 25 - Tests the SetOfInt class
  2. // tset.cpp
  3. #include <iostream.h>
  4. #include "set.h"
  5.  
  6. main()
  7. {
  8.     SetOfInt s;
  9.  
  10.     s.insert(77);
  11.     s.insert(33);
  12.     s.insert(500);
  13.     cout << s << endl;
  14.  
  15.     s.remove(77);
  16.     cout << s << endl;
  17.     cout << "s "
  18.          << (s.contains(77) ? "does" : "does not")
  19.          << " contain 77" << endl;
  20.     return 0;
  21. }
  22.  
  23. {77,33,500}
  24. {33,500}
  25. s does not contain 77
  26.  
  27.